<?php if(!defined('BASEPATH')) exit('No direct script allowed');

class mdl_user extends CI_Model{
	
	function __construct()
	{
		parent::__construct();
	}
	
	function get_item($id)
	{
		$this->db->flush_cache();		$this->db->from('siswa');		$this->db->where('id_siswa', $id);		return $this->db->get();		
	}		function get_item_res($id)	{		$this->db->flush_cache();		$this->db->from('siswa');		$this->db->where('id_siswa', $id);		//return $this->db->get();		return $this->db->get()->result();	}
	
	function getItemById($id)
	{
		$this->db->flush_cache();
		$this->db->where('ID_PENGUMUMAN', $id);
		return $this->db->get('BB_PENGUMUMAN');
	}

	function insert($data)
	{
		$this->db->flush_cache();
		$this->db->insert('BB_PENGUMUMAN', $data);
	}
	
	function update($id, $data)
	{
		$this->db->flush_cache();
		$this->db->where('PENGUMUMAN_ID', $id);
		$this->db->update('PENGUMUMAN', $data);
	}
	
	function delete($id)
	{
		$this->db->flush_cache();
		$this->db->delete('PENGUMUMAN', array('PENGUMUMAN_ID' => $id));
	}
	
}